﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using HigLabo.Net.Extensions;
using Newtonsoft.Json.Linq;

namespace HigLabo.Net.Twitter
{
    /// <summary>
    /// 
    /// </summary>
    public class Memberships : ResponseObject
    {
        /// <summary>
        /// 
        /// </summary>
        public Int64 PreviousCursor { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public String PreviousCursorStr { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public Int64 NextCursor { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public String NextCursorStr { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public ListCollection Lists { set; get; }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="jsonText"></param>
        public Memberships(String jsonText)
        {
            this.SetProperty(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="jsonText"></param>
        public override void SetProperty(string jsonText)
        {
            var d = this.SetData(jsonText);

            this.PreviousCursor = d.ToInt64("previous_cursor") ?? this.PreviousCursor;
            this.PreviousCursorStr = d.ToString("previous_cursor_str");
            this.NextCursor = d.ToInt64("next_cursor") ?? this.NextCursor;
            this.NextCursorStr = d.ToString("next_cursor_str");
            this.Lists = new ListCollection(d.ToString("lists"));
        }
    }
}
